package com.yangyouqi.posthorse.core.service;

import com.yangyouqi.posthorse.core.domain.Customer;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * 顾客服务类
 *
 * @author 杨友奇
 * @Time 2018/6/5
 */
public interface CustomerService {
    /**
     * 查询用户
     */
    public Boolean existsusername(String name);
    /**
     * 注册
     */
    public Customer register(Customer customer);
    /**
     * 登陆
     */
    public Customer login(String name, String password);

    /**
     * 顾客列表(分页)
     */
    public Page<Customer> list(Pageable pageable);

    /**
     * 顾客详情
     */
    public Customer get(Long id);

    /**
     * 修改顾客
     */
    public Customer update(Customer customer);

    /**
     * 申请配送资格
     * @param id
     * @return
     */
    public Customer applyToDistributor(Long id);

    /**
     * 确认配送资格
     * @param id
     * @param status(2:通过，9：不通过)
     * @return
     */
    public Customer confirmToDistributor(Long id, Integer status) throws Exception;

    /**
     * 获取所有配送员信息
     * @return
     */
    public List<Customer> listAllDistributor();


}
